import cv2
from t02 import Hand_d
camera=cv2.VideoCapture(0)
hand=Hand_d()
while 1:
    success,img=camera.read()
    if success:
        img=cv2.flip(img,1)
        hand.process(img)
        position=hand.find_positions(img)
        print(position)
        # left_finger=position['Left'].get(8,None)
        # if left_finger:
        #     cv2.circle(img,(left_finger[0],left_finger[1]),10,(0,0,255),cv2.FILLED)
        cv2.imshow('Video',img)
    k=cv2.waitKey(1)
    if k==ord('q'):
        break
camera.release()#释放摄像头
cv2.destroyAllWindows()
